/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Entidades;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Daniel
 */
@Entity
@Table(name = "reservas")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Reservas.findAll", query = "SELECT r FROM Reservas r"),
    @NamedQuery(name = "Reservas.findByIdreseeva", query = "SELECT r FROM Reservas r WHERE r.idreseeva = :idreseeva"),
    @NamedQuery(name = "Reservas.findByFecha", query = "SELECT r FROM Reservas r WHERE r.fecha = :fecha"),
    @NamedQuery(name = "Reservas.findByDescripcion", query = "SELECT r FROM Reservas r WHERE r.descripcion = :descripcion")})
public class Reservas implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idreseeva")
    private Integer idreseeva;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fecha")
    @Temporal(TemporalType.DATE)
    private Date fecha;
    @Size(max = 100)
    @Column(name = "descripcion")
    private String descripcion;
    @JoinColumn(name = "maquina", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Maquinas maquina;
    @JoinColumn(name = "horas_reserva", referencedColumnName = "id_horas_reservas")
    @ManyToOne(optional = false)
    private Horasreserva horasReserva;
    @JoinColumn(name = "estado_reserva", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Estados estadoReserva;
    @JoinColumn(name = "numdoc", referencedColumnName = "identificacion")
    @ManyToOne(optional = false)
    private Clientes numdoc;

    public Reservas() {
    }
/**
     * Metodo accesor 
     *
     * @return
     */
    public Reservas(Integer idreseeva) {
        this.idreseeva = idreseeva;
    }
/**
     * Metodo accesor 
     *
     * @return
     */
    public Reservas(Integer idreseeva, Date fecha) {
        this.idreseeva = idreseeva;
        this.fecha = fecha;
    }
/**
     * Metodo accesor 
     *
     * @return
     */
    public Integer getIdreseeva() {
        return idreseeva;
    }
/**
     * Metodo accesor 
     *
     * @return
     */
    public void setIdreseeva(Integer idreseeva) {
        this.idreseeva = idreseeva;
    }
/**
     * Metodo accesor 
     *
     * @return
     */
    public Date getFecha() {
        return fecha;
    }
/**
     * Metodo accesor 
     *
     * @return
     */
    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }
/**
     * Metodo accesor 
     *
     * @return
     */
    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }
/**
     * Metodo accesor 
     *
     * @return
     */
    public Maquinas getMaquina() {
        return maquina;
    }
/**
     * Metodo accesor 
     *
     * @return
     */
    public void setMaquina(Maquinas maquina) {
        this.maquina = maquina;
    }

    public Horasreserva getHorasReserva() {
        return horasReserva;
    }
/**
     * Metodo accesor 
     *
     * @return
     */
    public void setHorasReserva(Horasreserva horasReserva) {
        this.horasReserva = horasReserva;
    }
/**
     * Metodo accesor 
     *
     * @return
     */
    public Estados getEstadoReserva() {
        return estadoReserva;
    }
/**
     * Metodo accesor 
     *
     * @return
     */
    public void setEstadoReserva(Estados estadoReserva) {
        this.estadoReserva = estadoReserva;
    }
/**
     * Metodo accesor 
     *
     * @return
     */
    public Clientes getNumdoc() {
        return numdoc;
    }

    public void setNumdoc(Clientes numdoc) {
        this.numdoc = numdoc;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idreseeva != null ? idreseeva.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Reservas)) {
            return false;
        }
        Reservas other = (Reservas) object;
        if ((this.idreseeva == null && other.idreseeva != null) || (this.idreseeva != null && !this.idreseeva.equals(other.idreseeva))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entidades.Reservas[ idreseeva=" + idreseeva + " ]";
    }
    
}
